package com.speedchina.doormanager.exception;

import com.speedchina.doormanager.enums.ResultEnum;

public class GlobalException extends RuntimeException {

    private static final long serialVersionUID = 5342609240774296994L;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public GlobalException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public GlobalException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
